package com.lijie.ljblog.chess;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.lijie.ljblog.enums.ChessColorEnum;
import com.lijie.ljblog.model.Person;
import lombok.Data;

import java.util.HashMap;
import java.util.Map;
import java.util.UUID;

/**
 * 五子棋游戏房间
 * @Description
 * @Author lijie
 * @Date 2022/8/26 15:38
 **/
@Data
public class ChessGameRoom {
    private String roomId;
    private Integer playerOneId;
    private Integer playerTwoId;

    private Map<Integer, ChessColorEnum> playerColor;
    private Map<Integer, Person> opponent;

    private Chess chess;
    private ObjectMapper objectMapper = new ObjectMapper();
    public ChessGameRoom() {
        // 使用 uuid 作为唯一身份标识
        roomId = UUID.randomUUID().toString();
        chess=Chess.initChess(15);
        playerColor=new HashMap<>();
        opponent=new HashMap<>();
    }
}
